package web.fabrimind.sm.service.impl;

import java.util.List;
import web.fabrimind.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import web.fabrimind.sm.mapper.ProductionTeamMapper;
import web.fabrimind.sm.domain.ProductionTeam;
import web.fabrimind.sm.service.IProductionTeamService;

/**
 * 生产团队Service业务层处理
 * 
 * @author zhihui
 * @date 2025-03-30
 */
@Service
public class ProductionTeamServiceImpl implements IProductionTeamService 
{
    @Autowired
    private ProductionTeamMapper productionTeamMapper;

    /**
     * 查询生产团队
     * 
     * @param teamId 生产团队主键
     * @return 生产团队
     */
    @Override
    public ProductionTeam selectProductionTeamByTeamId(Long teamId)
    {
        return productionTeamMapper.selectProductionTeamByTeamId(teamId);
    }

    /**
     * 查询生产团队列表
     * 
     * @param productionTeam 生产团队
     * @return 生产团队
     */
    @Override
    public List<ProductionTeam> selectProductionTeamList(ProductionTeam productionTeam)
    {
        return productionTeamMapper.selectProductionTeamList(productionTeam);
    }

    /**
     * 新增生产团队
     * 
     * @param productionTeam 生产团队
     * @return 结果
     */
    @Override
    public int insertProductionTeam(ProductionTeam productionTeam)
    {
        productionTeam.setCreateTime(DateUtils.getNowDate());
        return productionTeamMapper.insertProductionTeam(productionTeam);
    }

    /**
     * 修改生产团队
     * 
     * @param productionTeam 生产团队
     * @return 结果
     */
    @Override
    public int updateProductionTeam(ProductionTeam productionTeam)
    {
        productionTeam.setUpdateTime(DateUtils.getNowDate());
        return productionTeamMapper.updateProductionTeam(productionTeam);
    }

    /**
     * 批量删除生产团队
     * 
     * @param teamIds 需要删除的生产团队主键
     * @return 结果
     */
    @Override
    public int deleteProductionTeamByTeamIds(Long[] teamIds)
    {
        return productionTeamMapper.deleteProductionTeamByTeamIds(teamIds);
    }

    /**
     * 删除生产团队信息
     * 
     * @param teamId 生产团队主键
     * @return 结果
     */
    @Override
    public int deleteProductionTeamByTeamId(Long teamId)
    {
        return productionTeamMapper.deleteProductionTeamByTeamId(teamId);
    }
}
